<?php

include("db/conexion.php");
include("db/cquery.php");

$query = new CQuery();

$id = $_GET['id'];

$video = $query->selectIMTV($id);
$video = mysql_fetch_array($video);

$web=str_replace('watch?v=', 'v/', $video['link']);
$ios=str_replace('watch?v=', 'embed/', $video['link']);

if ((strpos($_SERVER['HTTP_USER_AGENT'], "lackBerry"))||(strpos($_SERVER['HTTP_USER_AGENT'], "Android"))){ ?>
    <a href="<?php echo $video['linkbb'] ?>"><img src="<?php echo $video['imagebb'] ?>"/></a>
<?php }elseif((strpos($_SERVER['HTTP_USER_AGENT'], "iPhone"))){ ?>
        <iframe src="<?php echo $ios; ?>" frameborder="0" width="515" height="435"></iframe>
<?php }else{ ?>
        <iframe width="555" height="475" src="<?php echo $web; ?>"></iframe><br />
<?php } ?>